Revert "Improve counterscroll handling" This reverts commit c3a63721ee0613b73066c5166109c0dd054b926e. Reason for revert: Caused CLS benchmark regressions. Some are expected, like the change in shift-while-scrolled.html. Some look problematic, e.g. some results changed from 0 to non-0. Needs investigation. Original change's description: > Improve counterscroll handling > > Previously we tracked the maximum scroll offset in a viewport to ignore > counterscroll shifts, but it failed when > - There were multiple scrollers scroll at the same time. Tested by > external/wpt/layout-instability/shift-with-counterscroll-2.html. > - An invisible shift was countered by both scroll and transform, e.g. > move layout location by 100px, scroll by -50px, and transform by > -50px. Tested by > external/wpt/layout-instability/shift-with-counter-scroll-and-transform.html > > Now let PaintPropertyTreeBuilder track scroll delta, and pass the delta > to LayoutShiftTracker. > > Bug: 1182213 > Change-Id: I18366ff7bc0e96374a954bee1c1600b582681dd8 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2741240 > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > Reviewed-by: Chris Harrelson <chrishtr@chromium.org> > Reviewed-by: Steve Kobes <skobes@chromium.org> > Cr-Commit-Position: refs/heads/master@{#861702} Bug: 1182213, 1186894 Change-Id: I69ccdb7d132f73618777530e932578fbadee35e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2754072 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#862256} 
diff --git a/layout-instability/shift-while-scrolled.html b/layout-instability/shift-while-scrolled.html index 3cdd357..88eeede 100644 --- a/layout-instability/shift-while-scrolled.html +++ b/layout-instability/shift-while-scrolled.html 
@@ -26,8 +26,9 @@  // Generate a layout shift.  document.querySelector("#shift").style = "top: 60px";   - const moveDistanceInView = 100 - 60; - const expectedScore = computeExpectedScore(300 * 200, moveDistanceInView); + // Impact region: width * (height - scrollTop + moveDistance) + const expectedScore = computeExpectedScore( + 300 * (200 - 100 + 60), 60);    await watcher.promise;  assert_equals(watcher.score, expectedScore);